$(function () {

    var html_data = {
        baseConfig: baseConfig,
        sessionid: '',
        sessionid_q: '',
        default_address: null,
        selected_address_id: parseInt(GetQueryString('address_id')),
        payorder_id: parseInt(GetQueryString("payorder_id")),
        address_list: []

    };
    var app = new Vue({
        el: '#user_address_html',
        data: html_data,
        methods: {
            price_filter: price_filter,
            create_address: function () {
                location.href = 'goodsstore_modefy.html';
            },
            modefy_address: function (goodsstore_id) {
                location.href = 'goodsstore_modefy.html?goodsstore_id=' + goodsstore_id;
            },

            delete_address: function (address) {
                Magiclamp.mcConfirm("提示", "确认删除:"+address.name+" 吗？商品会归入自营店铺中。", function () {

                }, function () {
                    var parm = {};
                    parm['goodsstore_id'] = address.id;

                    // api.lgoods.delete_goodsstore(parm).then(function (d) {
                    //     api.lgoods.query_goodsstore_by_host_list().then(function (data) {
                    //         html_data.address_list = data.result.list;
                    //
                    //     });
                    // });
                });

            },
            page_back: function () {
                baseConfig.page_back();
            }
        }
    });

    html_data.sessionid = GetQueryString('sessionid');
    if (html_data.sessionid) {
        html_data.sessionid_q = "sessionid=" + html_data.sessionid;
        client_storage('sessionid', html_data.sessionid);
    }


    api.lgoods.query_goodsstore_by_buyer_list().then(function (data) {
        html_data.address_list = data.result.list;

    });


});
